// 统一請求路径前缀在libs/axios.js中修改
import { getRequest, putRequest, postRequest } from "@/libs/axios";

// 分頁获取會員評價
export const getMemberReview = (params) => {
  return getRequest("/member/evaluation", params);
};

// 根据id获取評價詳情
export const getMemberInfoReview = (id) => {
  return getRequest(`/member/evaluation/get/${id}`);
};

//回复評價信息
export const replyMemberReview = (id, params) => {
  return putRequest(`/member/evaluation/reply/${id}`, params);
};

// 获取會員註冊统计列表
export const getStatisticsList = (params) => {
  return getRequest("/statistics/view/list", params);
};

//   获取分頁
export const getMember = (params) => {
  return getRequest("/member/getByPage", params);
};

//  修改會員基本信息
export const updateMember = (params) => {
  return putRequest(`/member`, params);
};
//  添加或修改
export const insertOrUpdateSpec = (params) => {
  return postRequest("/memberNoticeSenter/insertOrUpdate", params);
};
//删除gUI个
export const delSpec = (id, params) => {
  return deleteRequest(`/goods/spec/del/${id}`, params);
};

//  获取會員列表
export const getMemberListData = (params) => {
  return getRequest("/member", params);
};

//  获取會員詳情
export const getMemberInfoData = (id) => {
  return getRequest(`/member/${id}`);
};

//  添加會員基本信息
export const addMember = (params) => {
  return postRequest(`/member`, params);
};

//  获取會員列表
export const getMemberAll = () => {
  return getRequest("/member/getAll");
};

//  增加或修改會員列表
export const operationMemberListData = (params) => {
  return postRequest("/member/insertOrUpdate", params);
};

//  增加或修改會員列表
export const deleteMemberListData = (ids) => {
  return deleteRequest(`/member/delByIds/${ids}`);
};

//添加會員收貨地址
export const addMemberAddress = (params) => {
  return postRequest(`/member/address`, params);
};
//修改會員收貨地址
export const editMemberAddress = (params) => {
  return putRequest(`/member/address`, params);
};

export const removeMemberAddress = (id) => {
  return deleteRequest(`/member/address/delById/${id}`);
};

// 获取预存款明細列表數据
export const getUserWallet = (params) => {
  return getRequest("/member/wallet/log", params);
};
// 获取充值記录列表數据
export const getUserRecharge = (params) => {
  return getRequest("/wallet/recharge", params);
};
//會員狀態修改
export const updateMemberStatus = (params) => {
  return putRequest("/member/updateMemberStatus", params);
};
// 获取预存款明細列表數据
export const getUserDeposit = (params) => {
  return getRequest("/deposit", params);
};

//查询會員的收貨地址
export const getMemberAddressData = (id, params) => {
  return getRequest(`/member/address/${id}`, params);
};
//查询會員历史積分
export const getHistoryPointData = (params) => {
  return getRequest(`/member/memberPointsHistory/getByPage`, params);
};
// 获取提现申請列表數据
export const getUserWithdrawApply = (params) => {
  return getRequest("/members/withdraw-apply", params);
};

// 审核提现申請
export const withdrawApply = (params) => {
  return postRequest("/members/withdraw-apply", params);
};

//查询會員预存款
export const getMemberWallet = (params) => {
  return getRequest(`/members/wallet/wallet`, params);
};
